CompareInfo *compare = data;
gint y1, y2;
- get_allocation_coords (compare->container, (GtkWidget *)a, &allocation1);
- get_allocation_coords (compare->container, (GtkWidget *)b, &allocation2);
+ if (!get_allocation_coords (compare->container, (GtkWidget *)a, &allocation1))
+ return 0;
+ if (!get_allocation_coords (compare->container, (GtkWidget *)b, &allocation2))
+ return 0;
y1 = allocation1.y + allocation1.height / 2;
y2 = allocation2.y + allocation2.height / 2;
{
CompareInfo compare;
GList *tmp_list;
+ GdkRectangle old_allocation;
compare.container = container;
compare.reverse = (direction == GTK_DIR_UP);
if (!old_focus)
old_focus = find_old_focus (container, children);
- if (old_focus)
+ if (old_focus && get_allocation_coords (container, old_focus, &old_allocation))
{
- GdkRectangle old_allocation;
gint compare_x1;
gint compare_x2;
gint compare_y;
/* Delete widgets from list that don't match minimum criteria */
- get_allocation_coords (container, old_focus, &old_allocation);
-
compare_x1 = old_allocation.x;
compare_x2 = old_allocation.x + old_allocation.width;
if (child != old_focus)
{
- get_allocation_coords (container, child, &child_allocation);
-
- child_x1 = child_allocation.x;
- child_x2 = child_allocation.x + child_allocation.width;
-
- if ((child_x2 <= compare_x1 || child_x1 >= compare_x2) /* No horizontal overlap */ ||
- (direction == GTK_DIR_DOWN && child_allocation.y + child_allocation.height < compare_y) || /* Not below */
- (direction == GTK_DIR_UP && child_allocation.y > compare_y)) /* Not above */
+ if (get_allocation_coords (container, child, &child_allocation))
{
- children = g_list_delete_link (children, tmp_list);
+ child_x1 = child_allocation.x;
+ child_x2 = child_allocation.x + child_allocation.width;
+
+ if ((child_x2 <= compare_x1 || child_x1 >= compare_x2) /* No horizontal overlap */ ||
+ (direction == GTK_DIR_DOWN && child_allocation.y + child_allocation.height < compare_y) || /* Not below */
+ (direction == GTK_DIR_UP && child_allocation.y > compare_y)) /* Not above */
+ {
+ children = g_list_delete_link (children, tmp_list);
+ }
}
+ else
+ children = g_list_delete_link (children, tmp_list);
}
tmp_list = next;
CompareInfo *compare = data;
gint x1, x2;
- get_allocation_coords (compare->container, (GtkWidget *)a, &allocation1);
- get_allocation_coords (compare->container, (GtkWidget *)b, &allocation2);
+ if (!get_allocation_coords (compare->container, (GtkWidget *)a, &allocation1))
+ return 0;
+ if (!get_allocation_coords (compare->container, (GtkWidget *)b, &allocation2))
+ return 0;
x1 = allocation1.x + allocation1.width / 2;
x2 = allocation2.x + allocation2.width / 2;
{
CompareInfo compare;
GList *tmp_list;
+ GdkRectangle old_allocation;
compare.container = container;
compare.reverse = (direction == GTK_DIR_LEFT);
if (!old_focus)
old_focus = find_old_focus (container, children);
- if (old_focus)
+ if (old_focus && get_allocation_coords (container, old_focus, &old_allocation))
{
- GdkRectangle old_allocation;
-
gint compare_y1;
gint compare_y2;
gint compare_x;
/* Delete widgets from list that don't match minimum criteria */
- get_allocation_coords (container, old_focus, &old_allocation);
-
compare_y1 = old_allocation.y;
compare_y2 = old_allocation.y + old_allocation.height;
if (child != old_focus)
{
- get_allocation_coords (container, child, &child_allocation);
-
- child_y1 = child_allocation.y;
- child_y2 = child_allocation.y + child_allocation.height;
-
- if ((child_y2 <= compare_y1 || child_y1 >= compare_y2) /* No vertical overlap */ ||
- (direction == GTK_DIR_RIGHT && child_allocation.x + child_allocation.width < compare_x) || /* Not to left */
- (direction == GTK_DIR_LEFT && child_allocation.x > compare_x)) /* Not to right */
+ if (get_allocation_coords (container, child, &child_allocation))
{
- children = g_list_delete_link (children, tmp_list);
+ child_y1 = child_allocation.y;
+ child_y2 = child_allocation.y + child_allocation.height;
+
+ if ((child_y2 <= compare_y1 || child_y1 >= compare_y2) /* No vertical overlap */ ||
+ (direction == GTK_DIR_RIGHT && child_allocation.x + child_allocation.width < compare_x) || /* Not to left */
+ (direction == GTK_DIR_LEFT && child_allocation.x > compare_x)) /* Not to right */
+ {
+ children = g_list_delete_link (children, tmp_list);
+ }
}
+ else
+ children = g_list_delete_link (children, tmp_list);
}
tmp_list = next;